package middlewareLogExtraction.model;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;

public class GzipHelper {
	public void extract(final String inFileName, String outFileName) throws IOException{
		GZIPInputStream gzipInputStream = new GZIPInputStream(
				new FileInputStream(inFileName));
		OutputStream out = new FileOutputStream(outFileName);
		byte[] buf = new byte[1024];
		int len;
		while ((len = gzipInputStream.read(buf)) > 0) {
			out.write(buf, 0, len);
		}
		gzipInputStream.close();
		out.close();
	}
}
